<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>安恩贝后台管理系统</title>
<#assign base=request.contextPath  />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="${base}/assets/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="${base}/assets/css/font-awesome.min.css" />
    <!--[if IE 7]>
	<link rel="stylesheet" href="${base}/assets/css/font-awesome-ie7.min.css" />
    <![endif]-->
    <link rel="stylesheet" href="${base}/assets/css/ace.min.css" />
    <link rel="stylesheet" href="${base}/assets/css/ace-rtl.min.css" />
    <link rel="stylesheet" href="${base}/assets/css/ace-skins.min.css" />
    <link rel="stylesheet" href="${base}/css/style.css"/>
    <!--[if lte IE 8]>
	<link rel="stylesheet" href="${base}/assets/css/ace-ie.min.css" />
    <![endif]-->
    <script src="${base}/assets/js/ace-extra.min.js"></script>
    <!--[if lt IE 9]>
	<script src="${base}/assets/js/html5shiv.js"></script>
	<script src="${base}/assets/js/respond.min.js"></script>
    <![endif]-->
    <!--[if !IE]> -->
    <script src="${base}/js/jquery-1.9.1.min.js"></script>
    <!-- <![endif]-->
    <!--[if IE]>
	<script type="text/javascript">window.jQuery || document.write("<script src='${base}/assets/js/jquery-1.10.2.min.js'>"+"<"+"script>");</script>
    <![endif]-->
    <script type="text/javascript">
        if("ontouchend" in document) document.write("<script src='${base}/assets/js/jquery.mobile.custom.min.js'>"+"<"+"script>");
    </script>
    <script src="${base}/assets/js/bootstrap.min.js"></script>
    <script src="${base}/assets/js/typeahead-bs2.min.js"></script>
    <!--[if lte IE 8]>
	<script src="${base}/assets/js/excanvas.min.js"></script>
    <![endif]-->
    <script src="${base}/assets/js/ace-elements.min.js"></script>
    <script src="${base}/assets/js/ace.min.js"></script>
    <script src="${base}/assets/layer/layer.js" type="text/javascript"></script>
    <script src="${base}/assets/laydate/laydate.js" type="text/javascript"></script>
    <link rel="stylesheet" href="${base}/js/layui/css/layui.css"  media="all">
    <script src="${base}/js/jquery.nicescroll.js" type="text/javascript"></script>
    <script src="${base}/js/layui/layui.js" charset="utf-8"></script>
    <style type="text/css">
        textarea{
            border: none;
            outline:none;
            max-width: 540px;
            height: 200px;
            overflow:hidden;
            resize:none;
        }
    </style>
    <script type="text/javascript">
        $(function(){
            var cid = $('#nav_list> li>.submenu');
            cid.each(function(i){
                $(this).attr('id',"Sort_link_"+i);

            })
        })
        jQuery(document).ready(function(){
            $.each($(".submenu"),function(){
                var $aobjs=$(this).children("li");
                var rowCount=$aobjs.size();
                var divHeigth=$(this).height();
                $aobjs.height(divHeigth/rowCount);
            });
            //初始化宽度、高度

            $("#main-container").height($(window).height()-76);
            $("#iframe").height($(window).height()-140);

            $(".sidebar").height($(window).height()-99);
            var thisHeight = $("#nav_list").height($(window).outerHeight()-173);
            $(".submenu").height();
            $("#nav_list").children(".submenu").css("height",thisHeight);

            //当文档窗口发生改变时 触发
            $(window).resize(function(){
                $("#main-container").height($(window).height()-76);
                $("#iframe").height($(window).height()-140);
                $(".sidebar").height($(window).height()-99);

                var thisHeight = $("#nav_list").height($(window).outerHeight()-173);
                $(".submenu").height();
                $("#nav_list").children(".submenu").css("height",thisHeight);
            });
            $(document).on('click','.iframeurl',function(){
                var cid = $(this).attr("name");
                var cname = $(this).attr("title");
                $("#iframe").attr("src",cid).ready();
                $("#Bcrumbs").attr("href",cid).ready();
                $(".Current_page a").attr('href',cid).ready();
                $(".Current_page").attr('name',cid);
                $(".Current_page").html(cname).css({"color":"#333333","cursor":"default"}).ready();
                $("#parentIframe").html('<span class="parentIframe iframeurl"> </span>').css("display","none").ready();
                $("#parentIfour").html(''). css("display","none").ready();
            });



        });
        /******/
        $(document).on('click','.link_cz > li',function(){
            $('.link_cz > li').removeClass('active');
            $(this).addClass('active');
        });
        /*******************/
        //jQuery( document).ready(function(){
        //	  $("#submit").click(function(){
        //	// var num=0;
        //     var str="";
        //     $("input[type$='password']").each(function(n){
        //          if($(this).val()=="")
        //          {
        //              // num++;
        //			   layer.alert(str+=""+$(this).attr("name")+"不能为空！\r\n",{
        //                title: '提示框',
        //				icon:0,
        //          });
        //             // layer.msg(str+=""+$(this).attr("name")+"不能为空！\r\n");
        //             layer.close(index);
        //          }
        //     });
        //})
        //	});

        /*********************点击事件*********************/
        $( document).ready(function(){
            $('#nav_list,.link_cz').find('li.home').on('click',function(){
                $('#nav_list,.link_cz').find('li.home').removeClass('active');
                $(this).addClass('active');
            });
//时间设置
            function currentTime(){
                var d=new Date(),str='';
                str+=d.getFullYear()+'年';
                str+=d.getMonth() + 1+'月';
                str+=d.getDate()+'日';
                str+=d.getHours()+'时';
                str+=d.getMinutes()+'分';
                str+= d.getSeconds()+'秒';
                return str;
            }

            setInterval(function(){$('#time').html(currentTime)},1000);
//修改密码
            $('.change_Password').on('click', function(){
                layer.open({
                    type: 1,
                    title:'修改密码',
                    area: ['300px','300px'],
                    shadeClose: true,
                    content: $('#change_Pass'),
                    btn:['确认修改'],
                    yes:function(index, layero){
                        if ($("#password").val()==""){
                            layer.alert('原密码不能为空!',{
                                title: '提示框',
                                icon:0,

                            });
                            return false;
                        }
                        if ($("#Nes_pas").val()==""){
                            layer.alert('新密码不能为空!',{
                                title: '提示框',
                                icon:0,

                            });
                            return false;
                        }

                        if ($("#c_mew_pas").val()==""){
                            layer.alert('确认新密码不能为空!',{
                                title: '提示框',
                                icon:0,

                            });
                            return false;
                        }
                        if(!$("#c_mew_pas").val || $("#c_mew_pas").val() != $("#Nes_pas").val() )
                        {
                            layer.alert('密码不一致!',{
                                title: '提示框',
                                icon:0,

                            });
                            return false;
                        }
                        else{
                            layer.alert('修改成功！',{
                                title: '提示框',
                                icon:1,
                            });
                            layer.close(index);
                        }
                    }
                });
            });
            $('#Exit_system').on('click', function(){
                layer.confirm('是否确定退出系统？', {
                            btn: ['是','否'] ,//按钮
                            icon:2,
                        },
                        function(){
                            $.ajax({
                                type : "POST", //提交方式
                                url :  "${base}/user/exit",//路径
                                success : function(data) {//返回数据根据结果进行相应的处理
                                     if(data==="true"){
                                         window.location.reload();
                                     }
                                }
                            });
                        });
            });
        });
        function link_operating(name,title){
            var cid = $(this).name;
            var cname = $(this).title;
            $("#iframe").attr("src",cid).ready();
            $("#Bcrumbs").attr("href",cid).ready();
            $(".Current_page a").attr('href',cid).ready();
            $(".Current_page").attr('name',cid);
            $(".Current_page").html(cname).css({"color":"#333333","cursor":"default"}).ready();
            $("#parentIframe").html('<span class="parentIframe iframeurl"> </span>').css("display","none").ready();
            $("#parentIfour").html(''). css("display","none").ready();


        }
    </script>
</head>
<body>
<div class="navbar navbar-default" id="navbar">
    <script type="text/javascript">
        try{ace.settings.check('navbar' , 'fixed')}catch(e){}
    </script>
    <div class="navbar-container" id="navbar-container">
        <div class="navbar-header pull-left">
            <a href="#" class="navbar-brand">
                <small>
                    <img src="${base}/img/logos.png" width="470px">
                </small>

            </a><!-- /.brand -->
        </div><!-- /.navbar-header -->
        <div class="navbar-header operating pull-left">

        </div>
        <div class="navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">
                <li class="light">
                    <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                        <span class="user-info" id="roleId"><small>欢迎光临,</small></span>
                        <span  class="time"><em id="time"></em></span>
                        <i class="icon-caret-down"></i>
                    </a>
                    <ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
                        <li class="divider"></li>
                        <li><a href="javascript:void(0)"   id="Exit_system"><i class="icon-off"></i>退出</a></li>
                    </ul>
                </li>



            </ul>
            <!-- <div class="right_info">

               <div class="get_time" >
               <span id="time" class="time">欢迎光临,管理员</span></div>
                <ul class="nav ace-nav">
                    <li><a href="javascript:ovid(0)" class="change_Password">修改密码</a></li>
                    <li><a href="javascript:ovid(0)" id="Exit_system">退出系统</a></li>

                </ul>
            </div>-->
        </div>
    </div>
</div>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try{ace.settings.check('main-container' , 'fixed')}catch(e){}
    </script>
    <div class="main-container-inner">
        <a class="menu-toggler" id="menu-toggler" href="#">
            <span class="menu-text"></span>
        </a>
        <div class="sidebar" id="sidebar">
            <script type="text/javascript">
                try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
            </script>

            <div id="menu_style" class="menu_style">
                <ul class="nav nav-list" id="nav_list">
              <#--      <!-- <li class="home"><a href="javascript:void(0)" name="home.ftl" class="iframeurl" title=""><i class="icon-home"></i><span class="menu-text"> 系统首页 </span></a></li> &ndash;&gt;

                    <li>
                        <a href="#" class="dropdown-toggle"><i class="icon-picture "></i><span class="menu-text"> 房态管理 </span><b class="arrow icon-angle-down"></b></a>
                        <ul class="submenu">
                            <li class="home"><a href="javascript:void(0)" name="ssss.html" title="房间状态整理显示" class="iframeurl"><i class="icon-double-angle-right"></i>房间状态整理显示</a></li>
                            <li class="home"><a href="javascript:void(0)" name="Sort_ads.html" title="智能计算可预订房间"  class="iframeurl"><i class="icon-double-angle-right"></i>智能计算可预订房间</a></li>
                            <li class="home"><a href="javascript:void(0)" name="Sort_ads.html" title="房间销售状态统计"  class="iframeurl"><i class="icon-double-angle-right"></i>房间销售状态统计</a></li>
                            <li class="home"><a href="javascript:void(0)" name="Sort_ads.html" title="退房退押金处理"  class="iframeurl"><i class="icon-double-angle-right"></i>退房退押金处理</a></li>
                        </ul>
                    </li>

                    <li>
                        <a href="#" class="dropdown-toggle"><i class="icon-credit-card"></i><span class="menu-text">护理记录</span><b class="arrow icon-angle-down"></b></a>
                        <ul class="submenu">
                            <li class="home"><a href="javascript:void(0)" name="Cover_management.html" title="妈妈护理记录存储" class="iframeurl"><i class="icon-double-angle-right"></i>妈妈护理记录存储</a></li>
                            <li class="home"><a href="javascript:void(0)" name="payment_method.html" title="宝宝护理记录存储" class="iframeurl"><i class="icon-double-angle-right"></i>宝宝护理记录存储</a></li>
                            <li class="home"><a href="javascript:void(0)" name="Payment_Configure.html" title=日常护理记录指导 class="iframeurl"><i class="icon-double-angle-right"></i>日常护理记录指导</a></li>
                            <li class="home"><a href="javascript:void(0)" name="Payment_Configure.html" title=护理日常工作安排 class="iframeurl"><i class="icon-double-angle-right"></i>护理日常工作安排</a></li>
                            <li class="home"><a href="javascript:void(0)" name="Payment_Configure.html" title=产康统计统计 class="iframeurl"><i class="icon-double-angle-right"></i>产康统计统计</a></li>
                        </ul>
                    </li>
                    <li>
                        <a href="#" class="dropdown-toggle"><i class="icon-user"></i><span class="menu-text">营养餐单</span><b class="arrow icon-angle-down"></b></a>
                        <ul class="submenu">
                            <li class="home"><a href="javascript:void(0)" name="user_list.html" title="月子餐单整体编排"  class="iframeurl"><i class="icon-double-angle-right"></i>月子餐单整体编排</a></li>
                            <li class="home"><a href="javascript:void(0)" name="member-Grading.html" title="厨房每日工作安排"  class="iframeurl"><i class="icon-double-angle-right"></i>厨房每日工作安排</a></li>
                            <li class="home"><a href="javascript:void(0)" name="integration.html" title="客户当日餐单显示"  class="iframeurl"><i class="icon-double-angle-right"></i>客户当日餐单显示</a></li>
                            <li class="home"><a href="javascript:void(0)" name="integration.html" title="每日采购材料统计"  class="iframeurl"><i class="icon-double-angle-right"></i>每日采购材料统计</a></li>

                        </ul>
                    </li>
                    <li><a href="#" class="dropdown-toggle"><i class="icon-group"></i><span class="menu-text"> 销售情况 </span><b class="arrow icon-angle-down"></b></a>
                        <ul class="submenu">

                            <li class="home"><a href="javascript:void(0)" name="admin_Competence.html" title="月销售金额"  class="iframeurl"><i class="icon-double-angle-right"></i>月销售金额</a></li>
                            <li class="home"><a href="javascript:void(0)" name="administrator.html" title="单数" class="iframeurl"><i class="icon-double-angle-right"></i>单数</a></li>
                            <li class="home"><a href="javascript:void(0)" name="admin_info.html" title="每月业绩对比" class="iframeurl"><i class="icon-double-angle-right"></i>每月业绩对比</a></li>
                            <li class="home"><a href="javascript:void(0)" name="admin_info.html" title="季度分析" class="iframeurl"><i class="icon-double-angle-right"></i>季度分析</a></li>
                            <li class="home"><a href="javascript:void(0)" name="admin_info.html" title="咨询客户次数" class="iframeurl"><i class="icon-double-angle-right"></i>咨询客户次数</a></li>
                            <li class="home"><a href="javascript:void(0)" name="admin_info.html" title="跟进客户次数" class="iframeurl"><i class="icon-double-angle-right"></i>跟进客户次数</a></li>
                            <li class="home"><a href="javascript:void(0)" name="admin_info.html" title="意向参观比" class="iframeurl"><i class="icon-double-angle-right"></i>意向参观比</a></li>

                            <li class="home"><a href="javascript:void(0)" name="admin_info.html" title="成交比" class="iframeurl"><i class="icon-double-angle-right"></i>成交比</a></li>
                            <li class="home"><a href="javascript:void(0)" name="admin_info.html" title="成交客户后续消费情况" class="iframeurl"><i class="icon-double-angle-right"></i>成交客户后续消费情况</a></li>
                            <li class="home"><a href="javascript:void(0)" name="admin_info.html" title="是否转介绍" class="iframeurl"><i class="icon-double-angle-right"></i>是否转介绍</a></li>
                            <li class="home"><a href="javascript:void(0)" name="admin_info.html" title="每个销售人员业绩统计和对比" class="iframeurl"><i class="icon-double-angle-right"></i>每个销售人员业绩统计和对比</a></li>
                        </ul>
                    </li>

                    <li>
                        <a href="#" class="dropdown-toggle"><i class="icon-user"></i><span class="menu-text">产品分析</span><b class="arrow icon-angle-down"></b></a>
                        <ul class="submenu">
                            <li class="home"><a href="javascript:void(0)" name="user_list.html" title="月子餐单整体编排"  class="iframeurl"><i class="icon-double-angle-right"></i>月子餐单整体编排</a></li>
                            <li class="home"><a href="javascript:void(0)" name="member-Grading.html" title="厨房每日工作安排"  class="iframeurl"><i class="icon-double-angle-right"></i>厨房每日工作安排</a></li>
                            <li class="home"><a href="javascript:void(0)" name="integration.html" title="客户当日餐单显示"  class="iframeurl"><i class="icon-double-angle-right"></i>客户当日餐单显示</a></li>
                            <li class="home"><a href="javascript:void(0)" name="integration.html" title="每日采购材料统计"  class="iframeurl"><i class="icon-double-angle-right"></i>每日采购材料统计</a></li>

                        </ul>
                    </li>-->
                </ul>
            </div>
            <script type="text/javascript">
                $("#menu_style").niceScroll({
                    cursorcolor:"#888888",
                    cursoropacitymax:1,
                    touchbehavior:false,
                    cursorwidth:"5px",
                    cursorborder:"0",
                    cursorborderradius:"5px"
                });
            </script>
            <div class="sidebar-collapse" id="sidebar-collapse">
                <i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
            </div>
            <script type="text/javascript">
                try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
            </script>
        </div>

        <div class="main-content">
            <script type="text/javascript">
                try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
            </script>
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li>
                        <i class="icon-home home-icon"></i>
                        <a href="${base}/user/index">首页</a>
                    </li>
                    <li class="active"><span class="Current_page iframeurl"></span></li>
                    <li class="active" id="parentIframe"><span class="parentIframe iframeurl"></span></li>
                    <li class="active" id="parentIfour"><span class="parentIfour iframeurl"></span></li>
                </ul>
            </div>
            <!--子页面-->
            <iframe id="iframe" style="border:0; width:100%; background-color:#FFF;"name="iframe" frameborder="0" src="${base}/user/home">  </iframe>


            <!-- /.page-content -->
        </div><!-- /.main-content -->


    </div><!-- /.main-container-inner -->

</div>
<!--底部样式-->

<div class="footer_style" id="footerstyle">
    <#--<script type="text/javascript">try{ace.settings.check('footerstyle' , 'fixed')}catch(e){}</script>-->
     <div class="site-demo-button" id="layerDemo" style="float: right">
         <i data-method="offset"  class="layui-btn layui-icon layui-icon-dialogue" onclick="msgClick()" style="font-size: 30px; background-color:#f2f2f2;color: #1E9FFF;"></i>
    </div>
       <#-- <div class="site-demo-button" id="layerDemo" style="margin-bottom: 0;">
            <button data-method="offset" class="layui-btn layui-btn-danger"><i class="layui-icon"></i></button>
        </div>-->

</div>
<!--修改密码样式-->
<div class="change_Pass_style" id="change_Pass">
    <ul class="xg_style">
        <li><label class="label_name">原&nbsp;&nbsp;密&nbsp;码</label><input name="原密码" type="password" class="" id="password"></li>
        <li><label class="label_name">新&nbsp;&nbsp;密&nbsp;码</label><input name="新密码" type="password" class="" id="Nes_pas"></li>
        <li><label class="label_name">确认密码</label><input name="再次确认密码" type="password" class="" id="c_mew_pas"></li>
    </ul>
</div>
<!-- /.main-container -->
<!-- basic scripts -->
<script>
    $.ajax({
        type : "POST", //提交方式
        url : "${base}/user/findMenu",//路径
        data :{username:$("#username").val(),password:$("#userpwd").val()},
        success : function(data) {//返回数据根据结果进行相应的处理
            data=JSON.stringify(data);

            //把后台查出的用户所有信息转成json对象  包括用户角色 和角色所拥有的菜单
            var dataJson=JSON.parse(data);
            //右上角角色
            $("#roleId").append(dataJson.roles.roleName+"："+dataJson.username);
            //获取该角色的所有菜单
            var menu=dataJson.roles.menuResourses;
            var pantid=[];
            var htm;
            for (var i=0;i<menu.length;i++){
                //如果是父节点
                if(menu[i].menuLev==1){

                    $("#nav_list").append(
                            ' <li ><a href="#" class="dropdown-toggle"><i class="'+menu[i].menuClass+'"></i><span class="menu-text">'+menu[i].menuName+' </span><b class="arrow icon-angle-down"></b></a><ul class="submenu" id="'+menu[i].id+'" >'
                              +
                            '</ul></li>'
                    );
                    pantid.push(menu[i].id);
                }

            }
              //循环所有菜单
            for (var j=0;j<menu.length;j++){
                //循环所有父节点ID数组
            for(var k=0;k<pantid.length;k++){
                //如果该次父节点循环 是该次菜单的 父节点
               if (pantid[k]==menu[j].parentId){
                   htm = document.getElementById(pantid[k]).innerHTML;
                   htm=htm+
                           ' <li class="home"><a href="javascript:void(0)" name="${base}/'+menu[j].menuUrl+'" title="'+menu[j].menuName+'" class="iframeurl"><i class="'+menu[j].menuClass+'"></i>'+menu[j].menuName+'</a></li>'+
                           '</li>';
                   document.getElementById(pantid[k]).innerHTML=htm;
                  }
                                  }
                         }

        }
    });


//浮动按钮
    layui.use('layer', function(){ //独立版的layer无需执行这一句
        var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
        //触发事件
        var active = {
            offset: function(othis){
                var type = othis.data('type')
                        ,text = othis.text();

                layer.open({
                    type: 2
                    ,area: ['550px','520px']
                    ,content: '${base}/messge/main.html'
                    ,btnAlign: 'r' //按钮居中

                });
            }
        };
        $('#layerDemo .layui-btn').on('click', function(){
            var othis = $(this), method = othis.data('method');
            active[method] ? active[method].call(this, othis) : '';
        });

    });






</script>
</body>
</html>

